<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
            background-color: pink;
        }
    </style>
</head>

<body>
    <div class="box"></div>
    <script>
        // 1、获取元素
        const box = document.querySelector('.box')
        // 通过js控制样式
        box.style.backgroundColor = 'green'//多组单词的采取 小驼峰命名
        box.style.border = '3px solid #ccc'//支持复合写法
        box.style.height = '300px'
    </script>
</body>

</html>